﻿using AutoMapper;
using MRSite.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MRSite.AutoMapper
{
    public class AutoCommonMapper : ICommonMapper
    {
        private readonly IMapper _mapper;

        public AutoCommonMapper(IMapper mapper)
        {
            _mapper = mapper;
        }

        public T Map<T>(object source)
        {
            return _mapper.Map<T>(source);
        }

        public TD Map<TS, TD>(TS source, TD destination)
        {
            return _mapper.Map(source, destination);
        }
    }
}
